package com.goldsprite.gsgengine.core.components;

import java.util.Collection;
import java.util.stream.Collectors;

public class Components {
	public static <T> Iterable<T> with(Collection<?> source, Class<T> type) {
		return source.stream()
			.filter(type::isInstance)
			.map(type::cast)
			.collect(Collectors.toList());
	}
}
